<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <title>Untitled Document</title>
        <link rel="stylesheet" type="text/css" href="../lib/resources/css/ext-all.css"/>
        <!-- Theme includes -->
        <link rel="stylesheet" type="text/css" title="blue" href="../lib/resources/css/xtheme-blue.css" />
        <link rel="stylesheet" type="text/css" title="gray" href="../lib/resources/css/xtheme-gray.css" />
        <link rel="stylesheet" type="text/css" title="access" href="../lib/resources/css/xtheme-access.css" />
        <link rel="stylesheet" type="text/css" title="slickness" href="../lib/resources/css/xtheme-slickness.css" />
        <link rel="stylesheet" type="text/css" title="olive" href="../lib/resources/css/xtheme-olive.css" />
        <link rel="stylesheet" type="text/css" title="pink" href="../lib/resources/css/xtheme-pink.css" />
        <link rel="stylesheet" type="text/css" title="silverCherry" href="../lib/resources/css/xtheme-silverCherry.css" />
        <link rel="stylesheet" type="text/css" title="purple" href="../lib/resources/css/xtheme-purple.css" />
        <link rel="stylesheet" type="text/css" title="darkgray" href="../lib/resources/css/xtheme-darkgray.css" />
        <link rel="stylesheet" type="text/css" title="orange" href="../lib/resources/css/xtheme-orange.css" />
        <link rel="stylesheet" type="text/css" title="midnight" href="../lib/resources/css/xtheme-midnight.css" />
        <link rel="stylesheet" type="text/css" title="darkblue" href="../lib/resources/css/ext-all-darkblue.css" />
        <link rel="stylesheet" type="text/css" title="gtheme" href="../lib/resources/css/xtheme-gtheme.css" />
        <link rel="stylesheet" type="text/css" title="2brave" href="../lib/resources/css/xtheme-2brave.css" />
        <link rel="stylesheet" type="text/css" title="theme20" href="../lib/resources/css/ext-all-theme20.css" />
        <link rel="stylesheet" type="text/css" href="css/CssStyle.css"/>
        <link rel="stylesheet" type="text/css" href="css/themes.css"/>
        <script type="text/javascript" src="../lib/js/ext-base-debug.js">
        </script>
        <script type="text/javascript" src="../lib/js/ext-all-debug.js">
        </script>
        <script type="text/javascript" src="../lib/js/ext-lang-zh_CN.js">
        </script>
        <script type="text/javascript" src="../lib/js/general.js">
        </script>
        <!-- ENDLIBS -->
        <script type="text/javascript" src="js/pluigin/TabCloseMenu.js">
        </script>
        <script type="text/javascript" src="js/tool/styleswitcher.js">
        </script>
        <script type="text/javascript" src="AccordinTreePanel.js">
        </script>
        <script type="text/javascript">
            Ext.ns('App');
            //菜单面板
            App.MenuPanel = QM.ui.MenuPanel.extend({
                root: 'menus',
                ref: 'menuPanel',
                url: 'menu.json',
                tbar: [{}],
                listeners: {
                    'click': Ext.emptyFn
                }
            });
            
            
            //工作区面板
            App.WorkPanel = QM.ui.WorkPanel.extend({
                constructor: function(config){
                    config = config || {};
                    Ext.applyIf(config, {
                        items: [{
                            title: '首页',
                            html: 'A simple tab'
                        }]
                    })
                    App.WorkPanel.superclass.constructor.call(this, config);
                },
                //tab：子组件 node：树节点 返回待添加组件
                loadChild: function(tab, node){
                	
                }
            });
            //负责直连工作区
            App.afterLoad = function(viewport){
                var qstr = window.location.href.split('?')[1];
                if (qstr) {
                    var ps = Ext.urlDecode(qstr);
                    var code = ps['code'];
                    viewport.menuPanel.on('afterload', function(){
                        viewport.workPanel.showTab(code);
                        viewport.doLayout();
                    }, null, {
                        single: true
                    });
                }
            }
            
            Ext.onReady(function(){
                Ext.QuickTips.init();
                Ext.BLANK_IMAGE_URL = '../lib/resources/images/default/tree/s.gif';
                ThemeManager.init('header');
                var menupanel = new App.MenuPanel();
                var workpanel = new App.WorkPanel();
                var view = new Ext.Viewport({
                    layout: 'border',
                    items: [{
                        cls: 'docs-header',
                        height: 30,
                        region: 'north',
                        xtype: 'box',
                        el: 'header',
                        border: false
                    }, {
                        region: 'south',
                        xtype: 'box',
                        el: 'bottom'
                    }, menupanel, workpanel]
                });
				
				
                ThemeManager.on('click', function(id){
                    menupanel.doLayout();
                });
                App.afterLoad(view);
            });
        </script>
    </head>
    <body>
        <div id="header">
            <div class="api-title">
                http://chemzqm.javaeye.com
            </div>
        </div>
        <div id="bottom">
            <h2>Powered By Ext3.2.0</h2>
        </div>
    </body>
</html>
